<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSysFormsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sys_forms', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title', 64)->default('')->comment('表单标题');
            $table->string('table_name', 64)->unique()->default('')->comment('表名');
            $table->tinyInteger('module')->default(1)->comment('模块');
            $table->boolean('is_using')->default(1)->comment('是否启用');
            $table->string('icon')->default('')->comment('图标路径');
            $table->boolean('is_system')->default(1)->comment('是否是系统表单');
            $table->boolean('is_delete')->default(0);
            $table->integer('create_uid')->default(0);
            $table->integer('update_uid')->default(0);
            $table->bigInteger('created_at')->default(0);
            $table->bigInteger('updated_at')->default(0);
            $table->tinyInteger('action_type')->default(1)->comment('操作类型 1新增 2修改 3删除 增量使用');
            $table->index(['updated_at'], 'idx_updatedat');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sys_forms');
    }
}
